package com.zzq.mapper;

import com.zzq.Model.Comment;
import com.zzq.Model.CommentRet;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentMapper {

    public List<Comment> getAll();

    public Comment getById(int commentId);

    public List<Comment> getByBody(String searchInfo);

    public int post(Comment comment);

    public int addLikes(int commentId);

    public int subLikes(int commentId);

    public int deleteById(int commentId);

    public int deleteByIds(@Param("commentIds")List<Integer> commentIds);

    public int editById(@Param("commentId")int commentId, @Param("body")String body);

    public List<Comment> getByArticleIdOrderByLikes(int articleId);

    public List<CommentRet> getByArticleId(int articleId);

    public List<Comment> getByUserId(int userId);

    public int getCountByArticleId(int articleId);
}
